<!DOCTYPE html><?php include 'library/core.php'; $admin_obj = new admin(); $mas0 = $admin_obj -> select_pages($_GET['idpage']); $mas = $mas0[0]; ?>
<html lang="ru">
<head>
	<meta charset="utf-8">
	<title><?php if(!empty($mas["seo_title"])): ?><?php echo $mas["seo_title"]; ?><?php else: ?><?php echo $mas["title"]; ?><?php endif; ?></title>
	<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=cyrillic,latin' rel='stylesheet' type='text/css'>
	<script type="text/javascript" src="template/js/jquery.js"></script>
	<script type="text/javascript" src="template/js/core.js"></script>
	<script type="text/javascript" src="template/js/location.js"></script>
	<meta name="description" content="<?php echo $mas["seo_description"]; ?>" />
	<meta name="keywords" content="<?php echo $mas["seo_keywords"]; ?>"/>
	<link rel="stylesheet" href="template/style.css" type="text/css" media="screen" />
</head>
<body>
<header>
	<div class="menu_bg">
		<div class="logo">
			<a href="index.php" title="Goldentime"><img src="images/header/logo.png" alt="Goldentime"/></a>
		</div>
		<?php if(isset($_SESSION['user']['id'])): ?>
		<nav>
			<ul>
				<?php
				$menu = $admin_obj->in_menu();
				if ($menu!=false){
					for ($i=0; $i<count($menu);$i++){
						echo '<li><a href="page.php?idpage='.$menu[$i]['id'].'"title="'.$menu[$i]['title'].'">'.$menu[$i]['title'].'</a></li>';
					}
				}
				?>
				<?php if(!empty($_SESSION['user']['id'])): ?><li><a href="admin/profile.php?action=cabinet">Перейти в кабинет</a></li><?php endif; ?>
			</ul>
		</nav>
		<?php endif; ?>
		<?php
			if(!isset($_SESSION['user']['id'])): ?>
			<div class="auth">
				<a href="register.php" class="user-register"></a>
				<a href="#" class="user-login"></a>
			</div>
		<?php endif; ?>
	</div>
</header>
<section class="inside">	
	<div class="page page-inside-content">
		<?php if(isset($_SESSION['user']['id'])): ?>
		<h1 class="page_title"><?php echo $mas["title"]; ?></h1>
		<div class="hr"></div>
		<?php echo str_replace(array("%username%","%id%"), array($_SESSION['user']['login'], $_SESSION['user']['id']), $mas['content']); ?>
		<?php endif; ?>
	</div>
</section>
<footer>
	<div class="in">
		<span>&copy;2010-2012. <a href="index.php" title="ЗОЛОТОЕ ВРЕМЯ">ЗОЛОТОЕ ВРЕМЯ. </a> Все права защищены.</span>
		<div class="counters">
			<a href="#">
				<img src="images/footer/counter.jpg" alt=""/>
			</a>
		</div>
		<?php if(isset($_SESSION['user']['id'])): ?>
		<nav>
			<ul>
				<?php
					$mas = $admin_obj->in_menu();
					if($mas != false){
						for ($i=0; $i<count($mas);$i++){
							echo '<li><a href="page.php?idpage='.$mas[$i]['id'].'" title="'.$mas[$i]['title'].'">'.$mas[$i]['title'].'</a></li>';
						}
					}						
				?>
			</ul>
		</nav>
		<?php endif; ?>
	</div>
</footer>
</body>
</head>